<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<%
	String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
	<title>修改联系人</title>
	<link href="<%=path%>/css/main.css" rel="stylesheet" type="text/css" />
	<script language="javascript" type="text/javascript"
		src="<%=path%>/js/register.js"></script>
	<script src="<%=path%>/js/jquery-1.4.4.js" type="text/javascript">
	</script>
	<script language="javascript" type="text/javascript"
			src="<%=path%>/js/common.js"></script>
	<style type="text/css">
.mycolor {
	color: #FF0000;
}
</style>
</head>

<body class="innerpage">
	<div class="margin10"></div>
	<form name="contract" method="post">
		<script type="text/javascript">
	jQuery(document).ready(
		function(){
			//性别
			initselect("gender",'${linkMan.gender}');
		
			jQuery("#submit").bind("click",
			function(){
					var message = changeuserinfo();
					if(message == false)
					{
						return false;
					} 
					var pk_supplier = jQuery("#pk_supplier_id").val();
					var pk_linkman = jQuery("#pk_linkman").val();
					var linkman = jQuery("#linkman").val();
					var linkemail = jQuery("#linkemail").val();
					var position = jQuery("#position").val();
					var gender = jQuery("#gender").val();
					var mobile = jQuery("#mobile").val();
					var tel = jQuery("#tel").val();
					//这里ajax提交
					jQuery.ajax({ 
		                type: "POST", 
		                async:false,
		                url:"<%=path%>/selfinfo/editcontractinfo", 
		                data:"pk_supplier="+pk_supplier+"&pk_linkman="+pk_linkman+"&linkman="+linkman+"&linkemail="+linkemail+"&position="+position+"&gender="+gender+"&mobile="+mobile+"&tel="+tel, 
		                dataType:"text", 
		                success:function(result){   
		                    if(jQuery.trim(result) == "1"){//去掉前后的空格
		                    	var url = "<%=path%>/selfinfo/contractlist";
		                    	location.href = url;
		                    }
		                    else{
		                    	alert('22222222');
		                    	jQuery("#message").html(result);
		                    }	
		                } 
		            }); 
				}
			);
		}	
		
	)
	
	
</script>
		<input type="hidden" id="pk_supplier_id" name="pk_supplier_id"
			value="${form.pk_supplier_id}">
		<input type="hidden" id="pk_linkman" name="pk_linkman"
			value="${form.pk_linkman}">
		<table border="0" class="subpage_table2" cellpadding="0"
			cellspacing="0" align="center" width="450">
			<tr>
				<td class="innertext" align="left">
					联系人：
				</td>
				<td class="innertext">
					<input type="text" class="textinput" id="linkman" name="linkman"
						value="${form.linkman}" />
					<span class="needfill">*</span>
				</td>
				<td class="innertext">
					&nbsp;
				</td>
				<td class="innertext" align="left">
					电子邮箱：
				</td>
				<td class="innertext">
					<input type="text" class="textinput" id="linkemail"
						name="linkemail" value="${form.linkemail}" />
					<span class="needfill">*</span>
				</td>
			</tr>
			<tr>
				<td class="innertext" align="left">
					职位：
				</td>
				<td class="innertext">
					<input type="text" class="textinput" id="position" name="position"
						value="${form.position}" />
					<span class="needfill">*</span>
				</td>
				<td class="innertext">
					&nbsp;
				</td>
				<td class="innertext" align="left">
					性别：
				</td>
				<td class="innertext">
					<select name="gender" id="gender" class="textstyle">
						<option value="1">
							男
						</option>
						<option value="2">
							女
						</option>
					</select>
					<span class="needfill">*</span>
				</td>
			</tr>
			<tr>
				<td class="innertext" align="left">
					手机：
				</td>
				<td class="innertext">
					<input type="text" class="textinput" name="mobile" id="mobile"
						value="${form.mobile}" />
					<span class="needfill">*</span>
				</td>
				<td class="innertext">
					&nbsp;
				</td>
				<td class="innertext" align="left">
					公司固定电话：
				</td>
				<td class="innertext">
					<input type="text" class="textinput" name="tel" id="tel"
						value="${form.tel}" />
					<span class="needfill">*</span>
					<span>加区号</span>
				</td>
			</tr>
		</table>
		<div class="margin20">
			<div id="message" class="mycolor">
				<c:out value="${ERROR_MESSAGE}" />
			</div>
		</div>
		<div class="cbuttonrow">
			<p align="center">
				<input type="button" id="submit" class="buttonok" value="保存修改" />
				<input type="button" class="buttonok" value="取消" onclick="hideMe();" />
			</p>
		</div>
	</form>
</body>
